From 03828953f00a04782dba4884298bba9a207d3046 Mon Sep 17 00:00:00 2001 From: "robertlipe@gmail.com" Date: Fri, 12 Aug 2011 04:02:29 +0000 Subject: [PATCH] Add a thin shim around QDateTime to make it more compatible with our C-inspired usage for creation_time. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4081 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/gbdatetime.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gpsbabel/gbdatetime.h diff --git a/gpsbabel/gbdatetime.h b/gpsbabel/gbdatetime.h new file mode 100644 index 000000000..6b56171bc --- /dev/null +++ b/gpsbabel/gbdatetime.h @@ -0,0 +1,18 @@ +// Copyright ME. + +#include + +// As this code began in C, we have several hundred places that set and +// read creation_time as a time_t. Provide some operator overloads to make +// that less painful. +class gbDateTime : public QDateTime { +public: + operator const time_t() const { + return this->toTime_t(); + } + const time_t& operator=(const time_t& t) { + this->setTime_t(t); + } +}; + + -- 2.30.2